﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Yoozoo.HRP.Runtime;


public class SetRimLightCameraDir : MonoBehaviour
{
    //[SerializeField]
    public Camera SceneCamera;
    private Light RimLight;

    // Start is called before the first frame update
    void Start()
    {
        RimLight = this.GetComponent<Light>();
    }

    // Update is called once per frame
    void LateUpdate()
    {
        if (HCameraManager.GetBaseCamera())
        {
            SceneCamera = HCameraManager.GetBaseCamera().Camera;
        }
        if (SceneCamera == null || RimLight == null)
        {
            //Debug.Log("PveCamera" + SceneCamera + "RimLight" + RimLight);
            return ;
        }
        RimLight.transform.position = SceneCamera.transform.position;
        RimLight.transform.rotation = SceneCamera.transform.rotation;
        //Debug.Log("RimLight.transform.rotation" + RimLight.transform.rotation);
    }
}
